class Solution
{
public:
    bool containsDuplicate(vector<int> &nums)
    {
        unordered_set<int> existed;
        for (int num : nums)
        {
            if (existed.count(num))
            {
                return true;
            }
            else
            {
                existed.insert(num);
            }
        }
        return false;
    }
};